package com.hzyc.internetshop.bean;

public class Page {
	
	private int nowpage=1;
	private int start;
	private int pagesize=10;
	private int maxpage;
	private String name;
	private String gys;
	private String first;
	private String second;
	
	
	
	public String getFirst() {
		return first;
	}


	public void setFirst(String first) {
		this.first = first;
	}


	public String getSecond() {
		return second;
	}


	public void setSecond(String second) {
		this.second = second;
	}


	public String getGys() {
		return gys;
	}


	public void setGys(String gys) {
		this.gys = gys;
	}


	@Override
	public String toString() {
		return "Page [nowpage=" + nowpage + ", start=" + start + ", pagesize="
				+ pagesize + ", maxpage=" + maxpage + ", name=" + name + "]";
	}


	public String getName() {
		return name;
	}


	public void setName(String name) {
		this.name = name;
	}

	
	
	public int getMaxpage() {
		return maxpage;
	}


	public void setMaxpage(int maxpage) {
		this.maxpage = maxpage;
	}


	public void startposition(){
		
		start = (nowpage-1)*pagesize;
	}


	public int getNowpage() {
		return nowpage;
	}


	public void setNowpage(int nowpage) {
		this.nowpage = nowpage;
	}


	public int getStart() {
		return start;
	}


	public void setStart(int start) {
		this.start = start;
	}


	public int getPagesize() {
		return pagesize;
	}


	public void setPagesize(int pagesize) {
		this.pagesize = pagesize;
	}
	
	public void uppage(int nowpage){
		this.nowpage=nowpage<=1?1:nowpage-1;
		
	}
	
	public void downpage(int nowpage){
		this.nowpage=nowpage<maxpage?nowpage+1:nowpage;
	}
	
	public void firstpage(){
		this.nowpage=1;
	}
	
	public void lastpage(){
		this.nowpage=maxpage;
	}
}
